class Solution:
    def isMonotonic(self, A) -> bool:
        return sorted(A) == A or sorted(A, reverse=True) == A

if __name__ == '__main__':
    s = Solution()
    print(s.isMonotonic([1, 1, 3]))
